package com.yupi.lcapiinterface.controller;
import com.lc.lcapiclientsdk.model.User;
import com.lc.lcapiclientsdk.util.SignUtil;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 功能：名称API
 * 作者：lc
 * 日期：2024/10/10 17:33
 */
@RestController
@RequestMapping("/name")
public class NameController {

    @GetMapping("/get")
    public String getName(String name) {
        return "GET 你的名字" + name;
    }

    @PostMapping("/post")
    public String postName(@RequestParam String name) {
        return "POST 你的名字" + name;
    }

    @PostMapping("/postByUser")
    public String postNameByUser(@RequestBody User user, HttpServletRequest request) {
        String accessKey = request.getHeader("accessKey");
        String nonce = request.getHeader("nonce");
        String body = request.getHeader("body");
        String timestamp = request.getHeader("timestamp");
        String sign = request.getHeader("sign");

        return "POST 你的名字" + user.getName();
    }
}
